/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.star.modules.sys.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 答疑Entity
 * @author L
 * @version 2018-09-04
 */
@Table(name="${_prefix}question", alias="a", columns={
		@Column(name="id", attrName="id", label="用户ID", isPK=true),
		@Column(name="question", attrName="question", label="问题"),
		@Column(name="answer", attrName="answer", label="答案"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.status , a.create_date DESC"
)
public class ShQuestion extends DataEntity<ShQuestion> {
	
	private static final long serialVersionUID = 1L;
	private String question;		// 问题
	private String answer;		// 答案
	
	public ShQuestion() {
		this(null);
	}

	public ShQuestion(String id){
		super(id);
	}
	
	@NotBlank(message="问题不能为空")
	@Length(min=0, max=100, message="问题长度不能超过 100 个字符")
	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}
	
	@NotBlank(message="答案不能为空")
	@Length(min=0, max=500, message="答案长度不能超过 500 个字符")
	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}
	
}